////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// This file is a part of PMCG project. PMCG is the acronym of Physical       //
// Methods in Computer Graphics.                                              //
//                                                                            //
// Classical algorithms in computer graphics use discrete objects in 3D space //
// like vectors, matrices, triangles, planes. Physical way use an  analytical //
// objects like function, scalar and vector fields. Physical way gives new    //
// look to classical algorithms and allows to overcome some difficulties of   //
// pure geometric methods.                                                    //
//                                                                            //
// Project site:                                                              //
//     http://code.google.com/p/pmcg/                                         //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

#ifndef TRIMESH_H
#define TRIMESH_H

#include <vector>

#include "Vector3D.h"

//! Triangular mesh in 3D space. Data format is the list of vertices and the
//! list of faces. Each vertex is the Vector3D and each face is the three int
//! numbers that are pointing to the vertex.
class TriMesh
{
// types
public:
    struct Face
    {
        int m_i0;
        int m_i1;
        int m_i2;

        Face(int i0, int i1, int i2)
            : m_i0(i0), m_i1(i1), m_i2(i2) { }
    };

    typedef std::vector<Vector3D> Vectors3D;
    typedef std::vector<Face> Faces;

// methods
public:
    TriMesh();
   ~TriMesh();

// members
public:
    Vectors3D m_vertices;
    Faces m_faces;
};

#endif // TRIMESH_H
